﻿using ParboiledSharp.parboiled.dataobjects;

namespace ParboiledSharp.parboiled.rules
{
    class None : ContainerRule
    {
        public None(params object[] rules)
        {
            SetRules(rules);
        }

        internal override bool Execute(Context context)
        {
            foreach (object rule in GetRules())
            {
                bool result = ExecuteRule(rule, context);
                if (result)
                {
                    return false;
                }
            }

            return true;
        }
    }
}
